package com.lhgray.sglhome.domain.usecase

import com.freightoa.foundation.presentation.domain.BaseUseCase
import com.lhgray.sglhome.data.repository.HomeRepository
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.android.components.ViewModelComponent
import javax.inject.Inject
@Module
@InstallIn(ViewModelComponent::class)
class HomeUseCase @Inject constructor(private val homeRepository: HomeRepository) : BaseUseCase() {

    suspend operator fun invoke(loginName: String, loginPassword: String): Boolean {
        return homeRepository.login(loginName, loginPassword)
            .map { true }.isSuccess
    }
}